#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int main()
{
	int* p = (int*)malloc(10 * sizeof(int));
	if (!p)
	{
		perror("malloc");
		return 1; 
	}
	int* k = (int*)realloc(p, 80);
	if (!k)
	{
		perror("relloc");
		return 1;
	}
	else
	p = k;
	int i = 0;
	for (i = 0; i < 10; i++)
	{
		*(p + i) = i + 1;
	}
	free(p);
	p = NULL;
	p = (int*)calloc(10, sizeof(int));
	if (!p)
	{
		perror("calloc");
		return 1;
	}
	for (i = 0; i < 10; i++)
	{
		printf("%d ", p[i]);
	}
	free(p);
	p = NULL;
	int*z = (int*)realloc(NULL, 40);
	p = z;
	free(p);
	p = NULL;
	return 0;
}